/** * 根据传入的类型名称,创建不同的控件 */
<template>
  <table table border="1" cellspacing="0" cellpadding="0">
    <tr v-for="item in modelValue" :key="item.name" v-show="item.display == undefined || item.display == true">
      <td class="tb-content">
        {{ item.label }}
      </td>
      <td class="tb-content">
        <DSubComp :key="item.name" :type="item.type" v-model="item.value" :options="item.data"></DSubComp>
      </td>
    </tr>
  </table>
</template>

<script setup lang="ts">
import type { IAttrConfig } from './IDComponent';
import DSubComp from './DSubComp.vue';

interface IProps {
  modelValue: IAttrConfig[];
}
defineProps<IProps>();
</script>

<style scoped>
.tb-content {
  padding: 2px;
}
</style>
